load("@rules_python//python:defs.bzl", "py_library")
load("@pip_deps//:requirements.bzl", "requirement")

package(
    default_testonly = 1,
    default_visibility = ["//visibility:public"],
)

licenses(["notice"])

py_library(
    name = "test_keys",
    srcs = ["__init__.py"],
    deps = [
        ":_create_test_key",
        ":_test_keys_container",
    ],
)

py_library(
    name = "_test_keys_container",
    srcs = ["_test_keys_container.py"],
    deps = [
        "//util:key_util",
        "@tink_py//tink/proto:tink_py_pb2",
    ],
)

py_test(
    name = "_test_keys_container_test",
    srcs = ["_test_keys_container_test.py"],
    deps = [
        ":test_keys",
        requirement("absl-py"),
        "@tink_py//tink/proto:tink_py_pb2",
    ],
)

py_library(
    name = "_test_keys_db",
    srcs = ["_test_keys_db.py"],
    deps = [":_test_keys_container"],
)

py_library(
    name = "_create_test_key",
    srcs = ["_create_test_key.py"],
    deps = [
        ":_test_keys_container",
        ":_test_keys_db",
        "//tink_config",
        "//util:key_util",
        "@tink_py//tink:cleartext_keyset_handle",
        "@tink_py//tink:tink_python",
        "@tink_py//tink/aead",
        "@tink_py//tink/daead",
        "@tink_py//tink/hybrid",
        "@tink_py//tink/jwt",
        "@tink_py//tink/mac",
        "@tink_py//tink/prf",
        "@tink_py//tink/proto:tink_py_pb2",
        "@tink_py//tink/signature",
        "@tink_py//tink/streaming_aead",
    ],
)

py_test(
    name = "_create_test_key_test",
    srcs = ["_create_test_key_test.py"],
    deps = [
        ":test_keys",
        "//tink_config",
        "//util:key_util",
        "//util:utilities",
        requirement("absl-py"),
        "@tink_py//tink/aead",
        "@tink_py//tink/daead",
        "@tink_py//tink/hybrid",
        "@tink_py//tink/jwt",
        "@tink_py//tink/mac",
        "@tink_py//tink/prf",
        "@tink_py//tink/proto:aes_gcm_py_pb2",
        "@tink_py//tink/proto:tink_py_pb2",
        "@tink_py//tink/signature",
        "@tink_py//tink/streaming_aead",
    ],
)
